<?php

class View_Helper
{

  protected $view;

  protected static $helpers = array();

  public static function getInstance($name, $view)
  {
    if (! isset(self::$helpers[$name])) {
      $class = 'View_Helper_' . Inflector::camelize($name);

      $filename = dirname(__file__) . '/' . $class . '.php';

      require_once($filename);

      self::$helpers[$name] = new $class($view);
    }

    return self::$helpers[$name];
  }

  protected function __construct($view)
  {
    $this->view = $view;
  }

}
